<!--{style}-->
.tablesorter td {border-bottom: none;padding: 5px 0px 5px 5px;}
#preview-img img{max-width:150px;max-height:200px;}
<!--{/style}-->

<!--{script}-->
$('#jiajucompanyvip_template').change(function (){
	var self = $(this);
	$('#preview-img').html('<img src="<!--{:__PUBLIC__}-->/images/common/ajax/loading.gif" />');
	$('#preview-img').html('<a title="'+$('option:selected', self).text()+'" href="'+$('option:selected', self).attr('data-url')+'" target="_blank"><img src="'+$('option:selected', self).attr('data-img')+'"/></a>');
});

$('#jiajucompanyvip_template option:selected').change();

function insertImg_(nAttachmentid,id){
	insertAttachmentthumb(id,nAttachmentid);
}

function insertImg1(nAttachmentid){
	insertImg_(nAttachmentid,'jiajucompanybanner_1');
}

function insertImg2(nAttachmentid){
	insertImg_(nAttachmentid,'jiajucompanybanner_2');
}

function insertImg3(nAttachmentid){
	insertImg_(nAttachmentid,'jiajucompanybanner_3');
}
<!--{/script}-->

<form action="" method="post" id="jiajucompanyviptemplateAdd" class="validate">
	<p><div id="result" class="none"></div></p>
	<table class="tablesorter" width="100%" cellspacing="0" cellpadding="0" border="0">
		<tr>
			<th width="100px" class="orange">商家全称</th>
			<td width="600px"><b class="greenlight"><!--{$oValue['jiajucompany_fullname']}--></b>
			</td>
		</tr>
		<tr>
			<td>广告设置</td>
			<td>
				<table width="100%" cellspacing="0" cellpadding="0" border="0">
					<tr>
						<td><input style="width:100px;" type="text" name="jiajucompanybanner[title][]" value="<!--{if isset($arrCurrentTemplates[0]['jiajucompanybanner_filetitle'])}--><!--{$arrCurrentTemplates[0]['jiajucompanybanner_filetitle']}--><!--{/if}-->" title="标题" /></td>
						<td><input style="width:100px;" type="text" name="jiajucompanybanner[link][]" value="<!--{if isset($arrCurrentTemplates[0]['jiajucompanybanner_link'])}--><!--{$arrCurrentTemplates[0]['jiajucompanybanner_link']}--><!--{/if}-->" title="链接" /></td>
						<td>
							<input style="float:left;width:200px;" type="text" name="jiajucompanybanner[img][]" id="jiajucompanybanner_1" value="<!--{if isset($arrCurrentTemplates[0]['jiajucompanybanner_filename'])}--><!--{$arrCurrentTemplates[0]['jiajucompanybanner_filename']}--><!--{/if}-->" readonly title="广告图片"/>
							<input type="button" value="<!--<lang package='__COMMON_LANG__@Common'>-->媒体<!--</lang>-->" class="alt_btn" onclick="globalAddattachment('insertImg1',1,1);">
							&nbsp;<span class="red" style="cursor:pointer;" onclick="$('#jiajucompanybanner_1').val('');">x</span>
						</td>
					</tr>
					<tr>
						<td><input style="width:100px;" type="text" name="jiajucompanybanner[title][]" value="<!--{if isset($arrCurrentTemplates[1]['jiajucompanybanner_filetitle'])}--><!--{$arrCurrentTemplates[1]['jiajucompanybanner_filetitle']}--><!--{/if}-->" title="标题" /></td>
						<td><input style="width:100px;" type="text" name="jiajucompanybanner[link][]" value="<!--{if isset($arrCurrentTemplates[1]['jiajucompanybanner_link'])}--><!--{$arrCurrentTemplates[1]['jiajucompanybanner_link']}--><!--{/if}-->" title="链接" /></td>
						<td>
							<input style="float:left;width:200px;" type="text" name="jiajucompanybanner[img][]" id="jiajucompanybanner_2" value="<!--{if isset($arrCurrentTemplates[1]['jiajucompanybanner_filename'])}--><!--{$arrCurrentTemplates[1]['jiajucompanybanner_filename']}--><!--{/if}-->" readonly title="广告图片"/>
							<input type="button" value="<!--<lang package='__COMMON_LANG__@Common'>-->媒体<!--</lang>-->" class="alt_btn" onclick="globalAddattachment('insertImg2',1,1);">
							&nbsp;<span class="red" style="cursor:pointer;" onclick="$('#jiajucompanybanner_2').val('');">x</span>
						</td>
					</tr>
					<tr>
						<td><input style="width:100px;" type="text" name="jiajucompanybanner[title][]" value="<!--{if isset($arrCurrentTemplates[2]['jiajucompanybanner_filetitle'])}--><!--{$arrCurrentTemplates[2]['jiajucompanybanner_filetitle']}--><!--{/if}-->" title="标题" /></td>
						<td><input style="width:100px;" type="text" name="jiajucompanybanner[link][]" value="<!--{if isset($arrCurrentTemplates[2]['jiajucompanybanner_link'])}--><!--{$arrCurrentTemplates[2]['jiajucompanybanner_link']}--><!--{/if}-->" title="链接" /></td>
						<td>
							<input style="float:left;width:200px;" type="text" name="jiajucompanybanner[img][]" id="jiajucompanybanner_3" value="<!--{if isset($arrCurrentTemplates[2]['jiajucompanybanner_filename'])}--><!--{$arrCurrentTemplates[2]['jiajucompanybanner_filename']}--><!--{/if}-->" readonly title="广告图片"/>
							<input type="button" value="<!--<lang package='__COMMON_LANG__@Common'>-->媒体<!--</lang>-->" class="alt_btn" onclick="globalAddattachment('insertImg3',1,1);">
							&nbsp;<span class="red" style="cursor:pointer;" onclick="$('#jiajucompanybanner_3').val('');">x</span>
						</td>
					</tr>
				</table>
			</td>
		</tr>
		<tr>
			<td>所选模板</td>
			<td>
				<select name="jiajucompanyvip_template" id="jiajucompanyvip_template">
					<!--<foreach for="arrTemplate">-->
					<option value="<!--{$key}-->" data-img="<!--{$value[1]}-->" data-url="<!--{$value[2]}-->" selected="selected"><!--{$value[0]--}--></option>
					<!--</foreach>-->
				</select>
			</td>
		</tr>
		<tr>
			<td>顶部大图</td>
			<td>
				<div id="preview-img"></div>
			</td>
		</tr>
	</table>
	<input type="hidden" id="value" name="value" value="<!--{$oValue['jiajucompany_id']}-->" />
</form>